Skip to content

Conversation

@rajatchopra
Copy link

@rajatchopra rajatchopra commented Sep 28, 2018

A document to help an operator developer to integrate the operator with the installer. It covers what files to keep where so that configurations can be properly generated.

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 28, 2018
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not recommended. Only special operators require this.
cc @smarterclayton

The files should be <internal order>_<name>.yaml like here https://github.com/openshift/machine-config-operator/tree/master/install

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

00-namaspace.yaml
...
03-roles.yaml
04-serviceaccount.yaml
05-deplopment.yaml

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upshot of the above document is that the operator should keep its static manifest files in manifests/ folder of the operator repository and manage image references through an image-references file.

The document above requires more than keeping in /manifests of the repo. I would recommend not duplicate here.

The order of creation of the files is alphabetical, so the files should be numbered like below to effectively create the service account before the deployment.

ClusterVersionOperator applies the manifests to cluster in alphabetical order. So it is recommended that manifests be order of dependencies.
For example,

  • a deployment requires service account, roles etc and,
  • everything requires the namespace to exist.

So the order of the manifests should be enforces like:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The document above requires more than keeping in /manifests of the repo. I would recommend not duplicate here.

Agreed on not duplicating here. And any references to this that we keep should talk about the operator images; the operator Git repository doesn't come into it.

But if we punt this portion of the docs to external docs (whether in a Google Doc or github.com/openshift/cluster-version-operator Markdown), what's left to talk about here? Just:

Almost everyone should use external docs. {details about when that won't work}. {where to put things when you add them to this repo}.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

00-namaspace.yaml
...
03-roles.yaml
04-serviceaccount.yaml
05-deplopment.yaml

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop this. not required for most operators other than internal ordering.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • either keep it in memory as users shouldn't be editing it.
  • push the discovered config to api, as users might change this in future.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abhinavdahiya do you have an example of 'push the discovered config to api, as users might change this in future'?

@openshift-ci-robot
Copy link
Contributor

@rajatchopra: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws 4f66f9763ee71ea9cbabc3f0dc1edf8757f29727 link /test e2e-aws

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Member

@wking wking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nits inline, take 'em if they sound useful ;).

More broadly, I'm not clear on how this is scoped vs. the Google Doc, and I feel like the CVO repository is feeling lonely and left-out. @smarterclayton, can you provide more details about where you see these docs being maintained long-term? If it's in multiple locations, I think we need clear scoping about what goes where so we can give good cross-links to guide newcomers between locations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The page title should be h1 (one #), and subsections should increment by one level. It's not our fault if we think GitHub styles them too big ;).

Also, do we expect other levels of operator docs besides this? It seems unlikely to me, in which case I'd prefer docs/dev/operators.md and

# Operator integration

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

h1 is indeed to big for a smallish document like this one. Too bad if someone is forced into a telescopic lens. Can I stick with h2/h4?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Headings should not be used for styling. That's what CSS is for. Just stick to the standard hierarchy.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.
Convinced? No.
Complied? Yes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The document above requires more than keeping in /manifests of the repo. I would recommend not duplicate here.

Agreed on not duplicating here. And any references to this that we keep should talk about the operator images; the operator Git repository doesn't come into it.

But if we punt this portion of the docs to external docs (whether in a Google Doc or github.com/openshift/cluster-version-operator Markdown), what's left to talk about here? Just:

Almost everyone should use external docs. {details about when that won't work}. {where to put things when you add them to this repo}.

Copy link
Member

@wking wking Sep 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth spending a bit more time (wherever these "standard approach" docs live), talking about how this wires in. As I understand it, you'd take the /manifests route with enough static content to get your operator launched, and then you pull everything else you need (e.g. the install config) live from well-known locations. You focus on the last part of that here, and the Google Doc focuses on the first part. I don't see anywhere that's tying them together, although the MCO link you have below probably gives a good example for folks who want to read the source ;).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done a bit of a shift up to tie the two methods (one for static, the other for templates). Review again please.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done a bit of a shift up to tie the two methods (one for static, the other for templates).

This paragraph looks largely unchanged from 4f66f97 -> 2650b11. I was thinking of an outline more like:

The recommended way

...Everyone following this integration path will need static manifests/configs (as discussed in the Google Doc) to launch their operator...

Dynamic configuration

Some operators will need dynamic configuration to accomplish their task. These operators should set up their static manifests/configs to launch their operator, and then have their operator fill in its configuration by pulling information from cluster resources. For example, you can pull the install-config as a config map:

...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "templateized files" -> "templates"?

And including the paths and variable names here seems brittle. But it's probably fine until we have commits we can link to showing good examples of adding a new operator so folks can pattern-match.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.
Agree on the paths and variable names. Will be intractable at some point.

@rajatchopra rajatchopra force-pushed the patch-1 branch 5 times, most recently from 2c6f306 to 2650b11 Compare October 3, 2018 00:05
@abhinavdahiya
Copy link
Contributor

/approve

@wking wking dismissed abhinavdahiya’s stale review October 3, 2018 20:12

He's approved this PR since: #377 (comment)

@wking
Copy link
Member

wking commented Oct 3, 2018

Can this be docs/dev/operators.md? Also, is the Google Doc public?

@rajatchopra
Copy link
Author

Can this be docs/dev/operators.md? Also, is the Google Doc public?

Renamed the file.
The doc is not public, but I guess the answer is have a PR in CVO repo with the contents of those docs.

@wking
Copy link
Member

wking commented Oct 3, 2018

The doc is not public, but I guess the answer is have a PR in CVO repo with the contents of those docs

@smarterclayton, would that be ok with you? If not, do we have a plan for public integration docs for "The recommended way"?

@rajatchopra
Copy link
Author

The doc is not public, but I guess the answer is have a PR in CVO repo with the contents of those docs

@smarterclayton, would that be ok with you? If not, do we have a plan for public integration docs for "The recommended way"?

Quick link to the doc in question here: https://docs.google.com/document/d/1CGZVEyuloZ9oD4NUArW6dnEpi0WFc6BP2tqPSwFZTCY/

@smarterclayton
Copy link
Contributor

smarterclayton commented Oct 4, 2018 via email

@rajatchopra
Copy link
Author

@wking PTAL: openshift/cluster-version-operator#34

Copy link
Contributor

@steveej steveej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questions and language nits in the comments. Another one would be to use render instead of fill up to describe the temple process.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use a ### headline here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use a ### headline here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/ue/eu/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/operators/operator's/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/example/an example/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the actual choice here in the last sentence, i.e. what's the alternative to "vendor the operator’s github pkg and return the entire list of configs and manifests in the Generate function"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

namaste or namespace ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can replace this reference, and possibly the whole recommended-way section, with a link to here now that openshift/cluster-version-operator#34 has landed.

@rajatchopra rajatchopra force-pushed the patch-1 branch 2 times, most recently from c734231 to 4f8e7ac Compare October 10, 2018 23:02
This document is meant for an operator author, who wants to integrate a second-level operator into the installer. The document is a guide on all the possible and acceptable methods.
@abhinavdahiya
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 10, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, rajatchopra

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [abhinavdahiya,rajatchopra]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 42f7541 into openshift:master Oct 10, 2018
@rajatchopra rajatchopra deleted the patch-1 branch October 11, 2018 20:11
wking added a commit to wking/cluster-version-operator that referenced this pull request Nov 27, 2018
This content is descended from openshift/installer@9c8a77dd (docs/dev:
Doc on how to integrate an operator, 2018-09-28,
openshift/installer#377), but handling dynamic configuration is a
generic issue, so the docs should live in the generic CVO repository.
This will make these docs more discoverable.  It will also allow the
installer docs to focus on installer-specific issues for the small
subset of operators that need direct installer bindings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants